<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title>Hello 小可爱</title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<link href="css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" type="text/css" href="css/home_css.css" />
		<link rel="stylesheet" type="text/css" href="css/tab-top-subpage.css" />
		<link rel="stylesheet" href="css/mui.min.css">
		<style>
			html,
			body {
				background-color: #efeff4;
			}
			
			.mui-bar~.mui-content .mui-fullscreen {
				top: 44px;
				height: auto;
			}
			
			.mui-pull-top-tips {
				position: absolute;
				top: -20px;
				left: 50%;
				margin-left: -25px;
				width: 40px;
				height: 40px;
				border-radius: 100%;
				z-index: 1;
			}
			
			.mui-bar~.mui-pull-top-tips {
				top: 24px;
			}
			
			.mui-pull-top-wrapper {
				width: 42px;
				height: 42px;
				display: block;
				text-align: center;
				background-color: #efeff4;
				border: 1px solid #ddd;
				border-radius: 25px;
				background-clip: padding-box;
				box-shadow: 0 4px 10px #bbb;
				overflow: hidden;
			}
			
			.mui-pull-top-tips.mui-transitioning {
				-webkit-transition-duration: 200ms;
				transition-duration: 200ms;
			}
			
			.mui-pull-top-tips .mui-pull-loading {
				margin: 0;
			}
			
			.mui-pull-top-wrapper .mui-icon,
			.mui-pull-top-wrapper .mui-spinner {
				margin-top: 7px;
			}
			
			.mui-pull-bottom-tips {
				text-align: center;
				background-color: #efeff4;
				font-size: 15px;
				line-height: 40px;
				color: #777;
			}
			
			.mui-pull-top-canvas {
				overflow: hidden;
				background-color: #fafafa;
				border-radius: 40px;
				box-shadow: 0 4px 10px #bbb;
				width: 40px;
				height: 40px;
				margin: 0 auto;
			}
			
			.mui-pull-top-canvas canvas {
				width: 40px;
			}
			
			.mui-slider-indicator.mui-segmented-control {
				background-color: #efeff4;
			}
		</style>
	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
			<h1 class="mui-title">首页</h1>
		</header>
		
		<nav class="mui-bar mui-bar-tab">

				<a id="defaultTab" class="mui-tab-item mui-active" href="/home.html">
					<span class="mui-icon mui-icon-home"></span>
					<span class="mui-tab-label">首页</span>
				</a>
				<a class="mui-tab-item" href="classify.html">
					<span class="mui-icon-extra mui-icon-extra-class"></span>
					<span class="mui-tab-label">分类</span>
				</a>
				<a class="mui-tab-item" href="user.html">
					<span class="mui-icon mui-icon-contact"></span>
					<span class="mui-tab-label">我的</span>
				</a>
			</nav>
		<div class="mui-content">
			<div id="slider" class="mui-slider mui-fullscreen">
				<div id="sliderSegmentedControl" class="mui-scroll-wrapper mui-slider-indicator mui-segmented-control mui-segmented-control-inverted">
					<div class="mui-scroll cl_home">
						<a class="mui-control-item mui-active" href="#item1mobile">
							推荐
						</a>
						<a class="mui-control-item " href="#item2mobile">
							热门
						</a>
						<a class="mui-control-item " href="#item3mobile">
							最新
						</a>
					</div>
				</div>
				<div class="mui-slider-group">
					<div id="item1mobile" class="mui-slider-item mui-control-content mui-active">
						<div class="box-a">
							<div class="box-a-l">
								<img src="img/1.jpg" data-preview-src="" data-preview-group="1" down/>
								<p>花的高雅</p>
							</div>

							<div class="box-a-l">
								<img src="img/2.jpg" data-preview-src="" data-preview-group="1" down/>
								<p>落日的余晖</p>
							</div>

							<div class="box-a-l">
								<img src="img/3.jpg" data-preview-src="" data-preview-group="1" down/>
								<p>大海的阳光</p>
							</div>

							<div class="box-a-l">
								<img src="img/4.jpg" data-preview-src="" data-preview-group="1" down/>
								<p>小姐姐的星辉</p>
							</div>

							<div class="box-a-l">
								<img src="img/5.jpg" data-preview-src="" data-preview-group="1" down/>
								<p>海鸥的身影</p>
							</div>

							<div class="box-a-l">
								<img src="img/6.jpg" data-preview-src="" data-preview-group="1" down/>
								<p>花篮的悠远</p>
							</div>

							<div class="box-a-l">
								<img src="img/7.jpg" data-preview-src="" data-preview-group="1" down/>
								<p>树林的静谧</p>
							</div>

							<div class="box-a-l">
								<img src="img/8.jpg" data-preview-src="" data-preview-group="1" down/>
								<p>眺望远方</p>
							</div>							
						</div>

					</div>
					<div id="item2mobile" class="mui-slider-item mui-control-content">
						<div class="box-a">
							<div class="box-a-l">
								<img src="img/9.jpg" data-preview-src="" data-preview-group="1" down/>
								<p>星空的神秘</p>
							</div>

							<div class="box-a-l">
								<img src="img/10.jpg" data-preview-src="" data-preview-group="1" down/>
								<p>山水画的高远</p>
							</div>

							<div class="box-a-l">
								<img src="img/11.jpg" data-preview-src="" data-preview-group="1" down/>
								<p>深邃的天空</p>
							</div>

							<div class="box-a-l">
								<img src="img/12.jpg" data-preview-src="" data-preview-group="1" down/>
								<p>美丽的珍珠</p>
							</div>

							<div class="box-a-l">
								<img src="img/13.jpg" data-preview-src="" data-preview-group="1" down/>
								<p>草丛中的落日</p>
							</div>

							<div class="box-a-l">
								<img src="img/15.jpg" data-preview-src="" data-preview-group="1" down/>
								<p>夕阳的璀璨</p>
							</div>

							<div class="box-a-l">
								<img src="img/1.jpg" data-preview-src="" data-preview-group="1" down/>
								<p>花的高雅</p>
							</div>

							<div class="box-a-l">
								<img src="img/16.jpg" data-preview-src="" data-preview-group="1" down/>
								<p>三叶草的自由</p>
							</div>
							
						</div>
					</div>
					
					<div id="item3mobile" class="mui-slider-item mui-control-content">
						<div class="box-a">
							<div class="box-a-l">
								<img src="img/8.jpg" data-preview-src="" data-preview-group="1" down/>
								<p>眺望远方</p>
							</div>

							<div class="box-a-l">
								<img src="img/7.jpg" data-preview-src="" data-preview-group="1" down/>
								<p>树林的静谧</p>
							</div>

							<div class="box-a-l">
								<img src="img/6.jpg" data-preview-src="" data-preview-group="1" down/>
								<p>花篮的悠远</p>
							</div>

							<div class="box-a-l">
								<img src="img/5.jpg" data-preview-src="" data-preview-group="1" down/>
								<p>海鸥的身影</p>
							</div>

							<div class="box-a-l">
								<img src="img/4.jpg" data-preview-src="" data-preview-group="1" down/>
								<p>小姐姐的星辉</p>
							</div>

							<div class="box-a-l">
								<img src="img/3.jpg" data-preview-src="" data-preview-group="1" down/>
								<p>大海的阳光</p>
							</div>

							<div class="box-a-l">
								<img src="img/2.jpg" data-preview-src="" data-preview-group="1" down/>
								<p>落日的余晖</p>
							</div>

							<div class="box-a-l">
								<img src="img/1.jpg" data-preview-src="" data-preview-group="1" down/>
								<p>花的高雅</p>
							</div>							
						</div>
					</div>
				</div>
			</div>
		</div>
		<script src="js/mui.min.js"></script>
		<script src="js/mui.pullToRefresh.js"></script>
		<script src="js/mui.pullToRefresh.material.js"></script>
		<script src="js/mui.zoom.js"></script>
		<script src="js/mui.previewimage.js"></script>

		<script>
			mui.init();
			mui.previewImage();
			(function($) {
				//阻尼系数
				var deceleration = mui.os.ios ? 0.003 : 0.0009;
				$('.mui-scroll-wrapper').scroll({
					bounce: false,
					indicators: true, //是否显示滚动条
					deceleration: deceleration
				});
				$.ready(function() {
					//循环初始化所有下拉刷新，上拉加载。
					$.each(document.querySelectorAll('.mui-slider-group .mui-scroll'), function(index, pullRefreshEl) {
						$(pullRefreshEl).pullToRefresh({
							down: {
								callback: function() {
									var self = this;
									setTimeout(function() {
										var ul = self.element.querySelector('.mui-table-view');
										ul.insertBefore(createFragment(ul, index, 10, true), ul.firstChild);
										self.endPullDownToRefresh();
									}, 1000);
								}
							},
							up: {
								callback: function() {
									var self = this;
									setTimeout(function() {
										var ul = self.element.querySelector('.mui-table-view');
										ul.appendChild(createFragment(ul, index, 5));
										self.endPullUpToRefresh();
									}, 1000);
								}
							}
						});
					});
					var createFragment = function(ul, index, count, reverse) {
						var length = ul.querySelectorAll('li').length;
						var fragment = document.createDocumentFragment();
						var li;
						for(var i = 0; i < count; i++) {
							li = document.createElement('li');
							li.className = 'mui-table-view-cell';
							li.innerHTML = '第' + (index + 1) + '个选项卡子项-' + (length + (reverse ? (count - i) : (i + 1)));
							fragment.appendChild(li);
						}
						return fragment;
					};
				});
			})(mui);
		</script>
	</body>

</html>
